const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
const webpack = require('webpack')
const merge = require('webpack-merge')
const baseConfig = require('./webpack.base')

module.exports = merge(baseConfig, {
    devServer: {
        hot: true,
        open: true,
        quiet: false,
        clientLogLevel: 'warning',
        port: 8080
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: 'index.html',
            inject: 'head'
        }),
        new webpack.NamedModulesPlugin(),
        new webpack.HotModuleReplacementPlugin(),
        new FriendlyErrorsWebpackPlugin({
            clearConsole: true
        })
    ],
    mode: 'development'}
)